package com.uzai.console.enums;

/**
 * 公众号授权状态
 * @Auther: cen
 * @Date: 2022-7-13 19:11:58
 * @Description:
 */
public enum WxpubAuthStatusEnum {
    NO_ATUH(0,"授权未完成"),
    AUTH_SUCCESS(1,"授权成功"),
    AUTH_FAIL(2,"授权取消"),
    ;

    private Integer id;
    private String desc;

    WxpubAuthStatusEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static WxpubAuthStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (WxpubAuthStatusEnum type: WxpubAuthStatusEnum.values()) {
            if (type.getId().intValue() == id.intValue()) {
                return type;
            }
        }
        return null;
    }
}
